package Creational_design_pattern.Singleton.Example1;

public class Client {
    public static void main(String[] args) {
        IdentityCardNo n1,n2;
        n1 = IdentityCardNo.getInstance();
        n2 = IdentityCardNo.getInstance();
        System.out.println("身份证号码是否一致："+ (n1 ==n2));

        String s1,s2;
        s1 = n1.getIdentityCardNo();
        s2=n2.getIdentityCardNo();
        System.out.println("第一次号码："+s1);
        System.out.println("第二次号码："+s2);
        System.out.println("两次号码是否相等："+s1.equalsIgnoreCase(s2));
        System.out.println("对象是否相等: "+(s1==s2));


    }
}
